package com.mingqijia.gassafety.authority.api.req.privilege;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * 创建权限请求
 * @author Damon S.
 * @version v0.2
 * @date 2021-06-19
 */
@Data
@ApiModel(value = "创建权限请求")
public class CreatePrivilegeReqDTO implements Serializable {

    @NotNull(message = "权限主体ID不能为空")
    @ApiModelProperty(value = "权限主体ID", required = true)
    @Pattern(regexp = "^[\\w\\d]{1,32}$", message = "ID格式不合法")
    private String subjectId;

    @NotNull(message = "权限主体类型不能为空")
    @ApiModelProperty(value = "权限主体类型：1角色，2用户", required = true)
    private Integer subjectType;

    @NotNull(message = "对象类型不能为空")
    @ApiModelProperty(value = "权限对象类型：1菜单，2数据", required = true)
    private Integer privilegeType;

    @NotNull(message = "权限内容不能为空")
    @ApiModelProperty(value = "权限内容(格式：resId1,resId2,resId3,resId4,,,,", required = true)
    private String data;
}
